#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>

namespace xoxyy {
class String {
 private:
  char* buffer;

 public:
  String(char const* str);
  ~String();
  xoxyy::String& operator=(xoxyy::String const& str);
  char const& operator[](int64_t index);
  operator char const*();
  int64_t Len();
};
};

int main(int argc, char const* argv[]) {
  std::string stdStr;
  std::getline(std::cin, stdStr);

  xoxyy::String s1(stdStr.c_str());

  for (int64_t i = 0; i < s1.Len(); i++) {
    std::cout << s1[i] << std::endl;
  }

  //std::cout << s1[s1.Len()] << std::endl;

  return EXIT_SUCCESS;
}

xoxyy::String::String(char const* str) : buffer(NULL) {
  int64_t len = strlen(str);
  this->buffer = new char[len + 1];
  strcpy(this->buffer, str);
  this->buffer[len] = '\0';
  return;
}

xoxyy::String::~String() {
  if (this->buffer != NULL) {
    delete[] this->buffer;
    this->buffer = NULL;
    return;
  }

  return;
}

xoxyy::String& xoxyy::String::operator=(xoxyy::String const& str) {
  if (this == &str || str.buffer == NULL) {
    return *this;
  }

  if (this->buffer != NULL) {
    delete[] this->buffer;
    this->buffer = NULL;
  }

  int64_t len = strlen(this->buffer);
  this->buffer = new char[len + 1];
  strcpy(this->buffer, str.buffer);
  this->buffer[len] = '\0';
  return *this;
}

char const& xoxyy::String::operator[](int64_t index) {
  if (index >= 0 && index < this->Len()) {
    return this->buffer[index];
  }
  return this->buffer[this->Len()];
}

xoxyy::String::operator char const*() { return this->buffer; }

int64_t xoxyy::String::Len() { return strlen(this->buffer); }
